Prep for first npm publish (v0.3.0) - #2
Merged
Conversation
- Adds a publish workflow: publishes to the npm registry when a GitHub release is published, authenticating via npm trusted publishing (OIDC, automatic provenance); guards that the release tag matches the package version. - Bumps the version to 0.3.0 for the first registry release. - README: makes registry install primary; keeps the GitHub install as an alternative, now semver-pinned.
- Pins actions to commit SHAs — the job holds npm-publish capability (id-token: write), so mutable tags are an unnecessary risk. - Installs with --ignore-scripts so dependency install hooks can't execute in the publish job. - Moves the tag/version guard before the install so nothing runs for a mismatched release tag.
Per review: with no lockfile, `npm run check` resolves devDependencies fresh at release time and executes them in the job that holds `id-token: write`. Drop install and checks from the publish job — the `check` workflow already validates every push to main, and publishing needs no node_modules (zero runtime deps, no build, no lifecycle scripts). Also drop the now-unused setup-node cache config and add `--ignore-scripts` to `npm publish` as defense in depth.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
publishworkflow: publishes to the npm registry when a GitHub release is published, authenticating via npm trusted publishing (OIDC, automatic provenance); guards that the release tag matches the package version before publishing. The publish job runs no registry-delivered code (no install, no checks — thecheckworkflow already validates every push tomain), so nothing untrusted executes withid-tokenauthority.npm pack --dry-runverified: 5 files, 11 kB — LICENSE, README, package.json, the two bins).chalin/link-cache, workflowpublish.yaml).npm publishfrom the tagged commit, with 2FA), then configure the trusted publisher so later releases go through the workflow with provenance.publishedevent) — tag versions carefully.